import { defineStore } from 'pinia'
import { menuList } from '@/utils/menu'
/* 类型 */
import type { route } from '@/store/types/route'
export const userRouterStore = defineStore('router', {
  /* 路由数据仓库 */
  state: (): route => {
    return {
      route: menuList /* menu信息 */,
      tit: '首页',
      pathRouter: localStorage.getItem('route'),
    }
  },
  actions: {
    getRouterTitle({ title, path }: any) {
      this.tit = title
      this.pathRouter = path
      localStorage.setItem('route', path)
    },
  },
})
